<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>文章列表</title>
    <link rel="stylesheet" th:href="@{/css/menu.css}" >
    <style>
          table {
		  border-collapse: collapse;
		  position:sticky;
          margin:0 0 0 180px;
          width: 88%;
          border-collapse: collapse;
		}

		table td,
		table th {
		  border: 1px solid #ddd;
		  padding: 8px;
		  font-family: "华文新魏", serif;
		}

		/* 表头样式 */
		table th {
		  background-color: #f2f2f2;
		  color: #333;
		  font-weight: bold;
		  text-align: left;
		}

		/* 鼠标悬浮样式 */
		table tr:hover {
		  background-color: #f5f5f5;
		}

		/* 斑马线样式 */
		table tr:nth-child(even) {
		  background-color: #f2f2f2;
		}
</style>
</head>
<body>

<div th:replace="~{commons/menu::common-menu}"></div>

<table border="1">
    <tr>
        <th>id</th>
        <th>文章名称</th>
        <th>年级</th>
        <th>作者</th>
        <th>发布时间</th>
        <th>操作 </th>
    </tr>
    <tr th:each="a:${articlelist}">
        <td th:text="${a.ArticleID}"></td>
        <td th:text="${a.Title}"></td>
        <td th:text="${a.Grade}"></td>
        <td th:text="${a.Author}"></td>
        <td th:text="${a.PublishTime}"></td>
        <td>
            <a th:href="@{/user/articleDetails(id=${a.ArticleID})}" >查看</a>
        </td>
    </tr>
</table>


<script>
        function goBack() {
          window.history.go(-1);
        }
    </script>
</body>
</html>
